{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# SELECT names\n",
    "\n",
    "## Pattern Matching Strings\n",
    "This tutorial uses the **LIKE** operator to check names. We will be using the SELECT command on the table world:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Loading spark-stubs, spark-hive\n",
      "Adding Hive conf dir /opt/hive/conf to classpath\n",
      "Creating SparkSession\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "SLF4J: No SLF4J providers were found.\n",
      "SLF4J: Defaulting to no-operation (NOP) logger implementation\n",
      "SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<a target=\"_blank\" href=\"http://jupyter:4041\">Spark UI</a>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "\u001b[32mimport \u001b[39m\u001b[36m$ivy.$                                  \n",
       "\n",
       "\u001b[39m\n",
       "\u001b[32mimport \u001b[39m\u001b[36morg.apache.log4j.{Level, Logger}\n",
       "\u001b[39m\n",
       "\u001b[32mimport \u001b[39m\u001b[36morg.apache.spark._\n",
       "\u001b[39m\n",
       "\u001b[32mimport \u001b[39m\u001b[36morg.apache.spark.sql._\n",
       "\u001b[39m\n",
       "\u001b[32mimport \u001b[39m\u001b[36morg.apache.spark.sql.functions._\n",
       "\n",
       "\u001b[39m\n",
       "\u001b[36mspark\u001b[39m: \u001b[32mSparkSession\u001b[39m = org.apache.spark.sql.SparkSession@656d66e8"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import $ivy.`org.apache.spark::spark-sql:3.4.0`\n",
    "\n",
    "import org.apache.log4j.{Level, Logger}\n",
    "Logger.getLogger(\"org\").setLevel(Level.OFF)\n",
    "\n",
    "import org.apache.spark._\n",
    "import org.apache.spark.sql._\n",
    "import org.apache.spark.sql.functions._\n",
    "\n",
    "val spark = {\n",
    "    NotebookSparkSession.builder()\n",
    "    .progress(false)\n",
    "    .appName(\"app01\")\n",
    "    // .master(\"spark://192.168.31.31:7077\")\n",
    "    .master(\"local[*]\")\n",
    "    .config(\"spark.sql.warehouse.dir\", \n",
    "            \"hdfs://192.168.31.31:9000/user/hive/warehouse\") \n",
    "    .config(\"spark.cores.max\", \"4\") \n",
    "    .config(\"spark.executor.instances\", \"1\") \n",
    "    .config(\"spark.executor.cores\", \"2\") \n",
    "    .config(\"spark.executor.memory\", \"10g\") \n",
    "    .config(\"spark.shuffle.service.enabled\", \"false\") \n",
    "    .config(\"spark.dynamicAllocation.enabled\", \"false\") \n",
    "    .config(\"spark.sql.catalogImplementation\", \"hive\")\n",
    "    .config(\"spark.sql.repl.eagerEval.enabled\", \"true\")\n",
    "    .config(\"spark.driver.allowMultipleContexts\", \"true\")\n",
    "    .getOrCreate()\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\u001b[32mimport \u001b[39m\u001b[36mspark.implicits._\n",
       "\u001b[39m\n",
       "defined \u001b[32mfunction\u001b[39m \u001b[36msc\u001b[39m\n",
       "\u001b[36mhiveCxt\u001b[39m: \u001b[32msql\u001b[39m.\u001b[32mhive\u001b[39m.\u001b[32mHiveContext\u001b[39m = org.apache.spark.sql.hive.HiveContext@1f9fdddf"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import spark.implicits._\n",
    "def sc = spark.sparkContext\n",
    "val hiveCxt = new org.apache.spark.sql.hive.HiveContext(sc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "defined \u001b[32mclass\u001b[39m \u001b[36mRichDF\u001b[39m"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "// Credit to Aivean\n",
    "implicit class RichDF(val ds:DataFrame) {\n",
    "    def showHTML(limit: Int = 50, truncate: Int = 100) = {\n",
    "        import xml.Utility.escape\n",
    "        val data = ds.take(limit)\n",
    "        val header = ds.schema.fieldNames.toSeq        \n",
    "        val rows: Seq[Seq[String]] = data.map { row =>\n",
    "          row.toSeq.map {cell =>\n",
    "            val str = cell match {\n",
    "              case null => \"null\"\n",
    "              case binary: Array[Byte] => binary.map(\"%02X\".format(_)).mkString(\"[\", \" \", \"]\")\n",
    "              case array: Array[_] => array.mkString(\"[\", \", \", \"]\")\n",
    "              case seq: Seq[_] => seq.mkString(\"[\", \", \", \"]\")\n",
    "              case _ => cell.toString\n",
    "            }\n",
    "            if (truncate > 0 && str.length > truncate) {\n",
    "              // do not show ellipses for strings shorter than 4 characters.\n",
    "              if (truncate < 4) str.substring(0, truncate)\n",
    "              else str.substring(0, truncate - 3) + \"...\"\n",
    "            } else {\n",
    "              str\n",
    "            }\n",
    "          }: Seq[String]\n",
    "        }\n",
    "    publish.html(s\"\"\" <table>\n",
    "                <tr>\n",
    "                 ${header.map(h => s\"<th>${escape(h)}</th>\").mkString}\n",
    "                </tr>\n",
    "                ${rows.map {row =>\n",
    "                  s\"<tr>${row.map{c => s\"<td>${escape(c)}</td>\" }.mkString}</tr>\"\n",
    "                }.mkString}\n",
    "            </table>\n",
    "        \"\"\")\n",
    "    }\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\u001b[36mworld\u001b[39m: \u001b[32mDataFrame\u001b[39m = [name: string, continent: string ... 6 more fields]"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "val world = hiveCxt.table(\"sqlzoo.world\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1.\n",
    "\n",
    "You can use `WHERE name LIKE 'B%'` to find the countries that start with \"B\".\n",
    "\n",
    "The % is a _wild-card_ it can match any characters\n",
    "\n",
    "**Find the country that start with Y**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       " <table>\n",
       "                <tr>\n",
       "                 <th>name</th>\n",
       "                </tr>\n",
       "                <tr><td>Yemen</td></tr>\n",
       "            </table>\n",
       "        "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "(world.filter($\"name\".rlike(\"^[Yy]\"))\n",
    " .select($\"name\").showHTML())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2.\n",
    "\n",
    "**Find the countries that end with y**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       " <table>\n",
       "                <tr>\n",
       "                 <th>name</th>\n",
       "                </tr>\n",
       "                <tr><td>Germany</td></tr><tr><td>Hungary</td></tr><tr><td>Italy</td></tr><tr><td>Norway</td></tr><tr><td>Paraguay</td></tr><tr><td>Turkey</td></tr><tr><td>Uruguay</td></tr><tr><td>Vatican City</td></tr>\n",
       "            </table>\n",
       "        "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "(world.filter($\"name\".rlike(\"[Yy]$\"))\n",
    " .select(\"name\").showHTML())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 3.\n",
    "\n",
    "Luxembourg has an **x** - so does one other country. List them both.\n",
    "\n",
    "**Find the countries that contain the letter x**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       " <table>\n",
       "                <tr>\n",
       "                 <th>name</th>\n",
       "                </tr>\n",
       "                <tr><td>Luxembourg</td></tr><tr><td>Mexico</td></tr>\n",
       "            </table>\n",
       "        "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "(world.filter($\"name\".contains(\"x\"))\n",
    " .select($\"name\").showHTML())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 4.\n",
    "\n",
    "Iceland, Switzerland end with **land** - but are there others?\n",
    "\n",
    "**Find the countries that end with land**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       " <table>\n",
       "                <tr>\n",
       "                 <th>name</th>\n",
       "                </tr>\n",
       "                <tr><td>Finland</td></tr><tr><td>Iceland</td></tr><tr><td>Ireland</td></tr><tr><td>New Zealand</td></tr><tr><td>Poland</td></tr><tr><td>Switzerland</td></tr><tr><td>Thailand</td></tr>\n",
       "            </table>\n",
       "        "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "(world.filter($\"name\".like(\"%land\"))\n",
    " .select($\"name\").showHTML())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 5.\n",
    "\n",
    "Columbia starts with a **C** and ends with **ia** - there are two more like this.\n",
    "\n",
    "**Find the countries that start with C and end with ia**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       " <table>\n",
       "                <tr>\n",
       "                 <th>name</th>\n",
       "                </tr>\n",
       "                <tr><td>Cambodia</td></tr><tr><td>Colombia</td></tr><tr><td>Croatia</td></tr>\n",
       "            </table>\n",
       "        "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "(world.filter($\"name\".rlike(\"^C.*ia$\"))\n",
    " .select($\"name\").showHTML())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 6.\n",
    "Greece has a double **e** - who has **a** double **o**?\n",
    "\n",
    "**Find the country that has oo in the name**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       " <table>\n",
       "                <tr>\n",
       "                 <th>name</th>\n",
       "                </tr>\n",
       "                <tr><td>Cameroon</td></tr>\n",
       "            </table>\n",
       "        "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "(world.filter($\"name\".contains(\"oo\"))\n",
    " .select($\"name\").showHTML())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 7.\n",
    "\n",
    "Bahamas has three **a** - who else?\n",
    "\n",
    "**Find the countries that have three or more a in the name**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       " <table>\n",
       "                <tr>\n",
       "                 <th>name</th>\n",
       "                </tr>\n",
       "                <tr><td>Antigua and Barbuda</td></tr><tr><td>Bahamas</td></tr><tr><td>Bosnia and Herzegovina</td></tr><tr><td>Canada</td></tr><tr><td>Equatorial Guinea</td></tr><tr><td>Guatemala</td></tr><tr><td>Jamaica</td></tr><tr><td>Kazakhstan</td></tr><tr><td>Madagascar</td></tr><tr><td>Malaysia</td></tr><tr><td>Marshall Islands</td></tr><tr><td>Mauritania</td></tr><tr><td>Nicaragua</td></tr><tr><td>Panama</td></tr><tr><td>Papua New Guinea</td></tr><tr><td>Paraguay</td></tr><tr><td>Saint Vincent and the Grenadines</td></tr><tr><td>Saudi Arabia</td></tr><tr><td>Tanzania</td></tr><tr><td>Trinidad and Tobago</td></tr>\n",
       "            </table>\n",
       "        "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "(world.filter($\"name\".rlike(\"(a.*){3,}\"))\n",
    " .select($\"name\").showHTML())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 8.\n",
    "\n",
    "India and Angola have an **n** as the second character. You can use the underscore as a single character wildcard.\n",
    "\n",
    "```sql\n",
    "SELECT name FROM world\n",
    " WHERE name LIKE '_n%'\n",
    "ORDER BY name\n",
    "```\n",
    "\n",
    "**Find the countries that have \"t\" as the second character.**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       " <table>\n",
       "                <tr>\n",
       "                 <th>name</th>\n",
       "                </tr>\n",
       "                <tr><td>Ethiopia</td></tr><tr><td>Italy</td></tr>\n",
       "            </table>\n",
       "        "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "(world.filter($\"name\".rlike(\"^.{1}t\"))\n",
    " .select($\"name\").showHTML())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 9.\n",
    "\n",
    "Lesotho and Moldova both have two o characters separated by two other characters.\n",
    "\n",
    "**Find the countries that have two \"o\" characters separated by two others.**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       " <table>\n",
       "                <tr>\n",
       "                 <th>name</th>\n",
       "                </tr>\n",
       "                <tr><td>Congo, Democratic Republic of</td></tr><tr><td>Congo, Republic of</td></tr><tr><td>Lesotho</td></tr><tr><td>Moldova</td></tr><tr><td>Mongolia</td></tr><tr><td>Morocco</td></tr><tr><td>Sao Tomé and Príncipe</td></tr>\n",
       "            </table>\n",
       "        "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "(world.filter($\"name\".rlike(\"o.{2}o\"))\n",
    " .select($\"name\").showHTML())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 10.\n",
    "\n",
    "Cuba and Togo have four characters names.\n",
    "\n",
    "**Find the countries that have exactly four characters.**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       " <table>\n",
       "                <tr>\n",
       "                 <th>name</th>\n",
       "                </tr>\n",
       "                <tr><td>Chad</td></tr><tr><td>Cuba</td></tr><tr><td>Fiji</td></tr><tr><td>Iran</td></tr><tr><td>Iraq</td></tr><tr><td>Laos</td></tr><tr><td>Mali</td></tr><tr><td>Oman</td></tr><tr><td>Peru</td></tr><tr><td>Togo</td></tr>\n",
       "            </table>\n",
       "        "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "(world.filter(length($\"name\") === 4)\n",
    " .select($\"name\").showHTML())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 11.\n",
    "\n",
    "The capital of **Luxembourg** is **Luxembourg**. Show all the countries where the capital is the same as the name of the country\n",
    "\n",
    "**Find the country where the name is the capital city.**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       " <table>\n",
       "                <tr>\n",
       "                 <th>name</th>\n",
       "                </tr>\n",
       "                <tr><td>Djibouti</td></tr><tr><td>Luxembourg</td></tr><tr><td>San Marino</td></tr><tr><td>Singapore</td></tr>\n",
       "            </table>\n",
       "        "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "(world.filter($\"name\" === $\"capital\")\n",
    " .select($\"name\").showHTML())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 12.\n",
    "\n",
    "The capital of **Mexico** is **Mexico City**. Show all the countries where the capital has the country together with the word \"City\".\n",
    "\n",
    "**Find the country where the capital is the country plus \"City\".**\n",
    "\n",
    "> _The concat function_    \n",
    "> The function concat is short for concatenate - you can use it to combine two or more strings."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       " <table>\n",
       "                <tr>\n",
       "                 <th>name</th><th>capital</th>\n",
       "                </tr>\n",
       "                <tr><td>Guatemala</td><td>Guatemala City</td></tr><tr><td>Kuwait</td><td>Kuwait City</td></tr><tr><td>Mexico</td><td>Mexico City</td></tr><tr><td>Panama</td><td>Panama City</td></tr>\n",
       "            </table>\n",
       "        "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "(world.filter($\"capital\" === concat($\"name\", lit(\" City\")))\n",
    "    .select($\"name\", $\"capital\")\n",
    "    .showHTML())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 13.\n",
    "\n",
    "**Find the capital and the name where the capital includes the name of the country.**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       " <table>\n",
       "                <tr>\n",
       "                 <th>name</th><th>capital</th>\n",
       "                </tr>\n",
       "                <tr><td>Andorra</td><td>Andorra la Vella</td></tr><tr><td>Djibouti</td><td>Djibouti</td></tr><tr><td>Guatemala</td><td>Guatemala City</td></tr><tr><td>Kuwait</td><td>Kuwait City</td></tr><tr><td>Luxembourg</td><td>Luxembourg</td></tr><tr><td>Mexico</td><td>Mexico City</td></tr><tr><td>Monaco</td><td>Monaco-Ville</td></tr><tr><td>Panama</td><td>Panama City</td></tr><tr><td>San Marino</td><td>San Marino</td></tr><tr><td>Singapore</td><td>Singapore</td></tr>\n",
       "            </table>\n",
       "        "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "(world.filter($\"capital\".contains($\"name\"))\n",
    "    .select($\"name\", $\"capital\").showHTML())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 14.\n",
    "\n",
    "**Find the capital and the name where the capital is an extension of name of the country.**\n",
    "\n",
    "You _should_ include **Mexico City** as it is longer than **Mexico**. You _should not_ include **Luxembourg** as the capital is the same as the country."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       " <table>\n",
       "                <tr>\n",
       "                 <th>capital</th><th>name</th>\n",
       "                </tr>\n",
       "                <tr><td>Andorra la Vella</td><td>Andorra</td></tr><tr><td>Guatemala City</td><td>Guatemala</td></tr><tr><td>Kuwait City</td><td>Kuwait</td></tr><tr><td>Mexico City</td><td>Mexico</td></tr><tr><td>Monaco-Ville</td><td>Monaco</td></tr><tr><td>Panama City</td><td>Panama</td></tr>\n",
       "            </table>\n",
       "        "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "(world.filter(($\"capital\".contains($\"name\")) &&\n",
    "              ($\"capital\" !== $\"name\"))\n",
    "    .select($\"capital\", $\"name\").showHTML())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 15.\n",
    "\n",
    "For **Monaco-Ville** the name is **Monaco** and the extension is **-Ville**.\n",
    "\n",
    "**Show the name and the extension where the capital is an extension of name of the country.**\n",
    "\n",
    "You can use the SQL function [REPLACE](https://sqlzoo.net/wiki/REPLACE)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       " <table>\n",
       "                <tr>\n",
       "                 <th>name</th><th>ext</th>\n",
       "                </tr>\n",
       "                <tr><td>Andorra</td><td> la Vella</td></tr><tr><td>Guatemala</td><td> City</td></tr><tr><td>Kuwait</td><td> City</td></tr><tr><td>Mexico</td><td> City</td></tr><tr><td>Monaco</td><td>-Ville</td></tr><tr><td>Panama</td><td> City</td></tr>\n",
       "            </table>\n",
       "        "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "(world.filter(($\"capital\".contains($\"name\")) &&\n",
    "              ($\"capital\" !== $\"name\"))\n",
    "    .withColumn(\"ext\", regexp_replace($\"capital\", lit($\"name\"), lit(\"\")))\n",
    "    .select($\"name\", $\"ext\")\n",
    "    .showHTML()\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "spark.stop()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Scala",
   "language": "scala",
   "name": "scala"
  },
  "language_info": {
   "codemirror_mode": "text/x-scala",
   "file_extension": ".sc",
   "mimetype": "text/x-scala",
   "name": "scala",
   "nbconvert_exporter": "script",
   "version": "2.12.15"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
